Skip to main content

JMS Selectors and Filtering

This page contains more detailed information on the use of the JMS Selector and filtering when requesting a subscription from the Local Actor API. The JMS Selector is used to subscribe on certain capabilities of the data available on AMQP, where filtering can be done on the header fields of the AMQP. The capabilities for which a JMS Selector can be created are fixed for all messages and are described in following table.

Overview of JMS Selectors

SelectorDescriptionExample(s)Possible values
dtapEnvironmentThe environment of the MI to subscribe to"dtapEnvironment='acceptance'", "dtapEnvironment='production'"
  • acceptance
  • production
protocolVersionThis field indicates the message type and which version. This can be used to susbcribe to a set version of a message type"protocolVersion='DENM:1.3.1'", "protocolVersion='IVIM:1.2.1'"
  • DENM:1.3.1
  • IVIM:1.2.1
  • MAPEM:1.3.1
  • SPATEM:1.3.1
  • CAM:1.4.1
  • SSM:1.3.1
  • SRM:1.3.1
  • DATEXII:3.4
messageTypeThe message type to subscribe to, ignoring the version"messageType='DENM'", "messageType='SPATEM'"
  • DENM
  • IVIM
  • MAPEM
  • SPATEM
  • CAM
  • SSM
  • SRM
quadTreeFilter on geographic region, described by quadkey list"quadTree LIKE '%,12020123223210,%'"
For multiple quadkeys the selector has to be repeated"(quadTree LIKE '%,12020123223210,%') OR (quadTree LIKE '%,12020123223212,%')"
custom-mobilidata-useCaseSelector to subscribe on specific Mobilidata DENM use cases"\"custom-mobilidata-useCase\" LIKE '%,4,%'"3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 25
For multiple use case subscriptions the selector has to be repeated"(\"custom-mobilidata-useCase\" LIKE '%,4,%') OR (\"custom-mobilidata-useCase\" LIKE '%,5,%' )"3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 25
publisherIdThe PIP which put the message on the MI"publisherId='BE00004'"
originatingCountryThe country which the message corresponds to"originatingCountry='BE'"
publicationIdPIP publication id"publicationId='BE00004:DENM_ACC_ACCIDENT_BREAKDOWN_01'"
warning

The field "custom-mobilidata-useCase" must be delimited when used in the selector (since it contains a hyphen)

Filtering

The MI allows a more fine-grained filtering when connecting to the AMQP service. These are based on the default AMQP Apache-filters. This filtering allows to subscribe on specific header field of the AMQP messages. Not all header fields are part of the capabilities, so not all fields can be added in the JMS Selector. This filtering allows the remaining fields to be added as a filter.

Example snippet in Go-lang for filtering on specific causeCode and subCauseCode. The format is similar to the JMS Selectors when filtering on multiple fields.

filter := amqp.NewSelectorFilter("causeCode=95 AND subCauseCode=0")

receiver, err = session.NewReceiver(context.Background(), endpoint.Source, &amqp.ReceiverOptions{ Filters: []amqp.LinkFilter{filter} })